Linux Raid mdadm Hint

# fdisk /dev/sdb

Command (m for help): d

Command (m for help): n

Command (m for help): n

Partition type

p   primary (0 primary, 0 extended, 4 free)

e   extended (container for logical partitions)

Select (default p): Enter

Using default response p.

Partition number (1-4, default 1): Enter

First sector (2048-1953525167, default 2048): Enter

Last sector, +sectors or +size{K,M,G,T,P} (2048-1953525167, default 1953525167): Enter

Created a new partition 1 of type 'Linux' and of size 931.5 GiB.

Command (m for help): t

Hex code (type L to list all codes): fd

Changed type of partition 'Linux' to 'Linux raid autodetect'.

Command (m for help): p

Disk /dev/sdd: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disklabel type: dos

Disk identifier: 0xd6944a98

Device     Boot Start        End    Sectors   Size Id Type

/dev/sdd1        2048 1953525167 1953523120 931.5G fd Linux raid autodetect

Command (m for help): w

---------------------------------------------------

# fdisk /dev/sdd

.... Repeat as above .....

---------------------------------------------------

---------------------------------------------------

# mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdd1

mdadm: /dev/sdb1 appears to contain an ext2fs file system

size=976761560K  mtime=Mon Dec 16 04:10:49 2019

mdadm: Note: this array has metadata at the start and

may not be suitable as a boot device.  If you plan to

store '/boot' on this device please ensure that

your boot-loader understands md/v1.x metadata, or use

--metadata=0.90

mdadm: /dev/sdd1 appears to contain an ext2fs file system

size=976761560K  mtime=Mon Dec 16 04:10:49 2019

Continue creating array? y

mdadm: Defaulting to version 1.2 metadata

mdadm: array /dev/md0 started.

---------------------------------------------------

# if you want to remove md0

mdadm --stop /dev/md0

mdadm --remove /dev/md0

mdadm --zero-superblock /dev/sdb1 /dev/sdd1

mdadm --detail /dev/md0

---------------------------------------------------

# for /boot

mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdd1 --metadata=0.90

---------------------------------------------------

# mkfs.ext4 /dev/md0

mke2fs 1.44.3 (10-July-2018)

Creating filesystem with 244157360 4k blocks and 61046784 inodes

Filesystem UUID: 8642383a-ab03-4cfc-aa08-fac31f6d6e0b

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,

102400000, 214990848

Allocating group tables: done

Writing inode tables: done

Creating journal (262144 blocks): done

Writing superblocks and filesystem accounting information: done

---------------------------------------------------

mdadm --detail /dev/md0

mkdir /D10T1

mount /dev/md0 /D10T1

---------------------------------------------------